/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Stratego;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

/**
 *
 * @author lipnz
 */
public class Kerkhof extends JPanel{
    private int aantalPionnen = 0;



    
    public Kerkhof(){
        setLayout(new GridLayout(0,4));
        Image img = new ImageIcon(getClass().getResource("images/VlagBlauw.PNG")).getImage();
      ImageIcon icon = new ImageIcon(img);

      System.out.println(icon.getIconWidth());
      System.out.println(icon.getIconHeight());

    System.out.println("icon = " + icon); // test for null

       for(int i = 0; i<40; i++){
             JLabel label = new JLabel(icon);
          label.setOpaque(true);
            // label.isVisible();
             //label.setText("bla");
           //  label.setIcon(icon);
             label.setPreferredSize(new Dimension(50,50));


          // icon.paintIcon(label, label.getGraphics(), 40, 40);
            add(label);
            aantalPionnen++;   
         //   System.out.println("icon van label = " + label.getIcon());
        }
    }



}
